<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目合格证信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>

<script type="text/javascript">
	var grid = null;
	var dtlId='${dtlId}';
	var isAuditNode = '${isAuditNode}';
	$(function () {
		initGrid();//grid
	});
//初始化列表
	function initGrid(){
		var params = {};
		params.dtlId = dtlId;
		$("#grid").ligerGrid({
	    	url: '<%=path%>/project/prjprdvehinfo/getPrjPrdDtlPrdInfoInitList.do?dtlId='+dtlId,
	    	method : 'get',
	    	//parms:params,
	        columns: [
	                  { display: '品牌', name: 'brCd', minWidth: 80 ,align:'left',
	  	            	enabledSort:true},
	  	      		  { display: '租赁物名称', name: 'prdNm', minWidth: 80,align:'left',
	  	             		render: function (rowdata, rowindex, value, column) { 
		  	            		var h = '';
		  	            		if(value){
		  	            		    h='<a  href="javascript:detailBtn(';
		  	            		    h+="'"+rowdata.dtlId+"',";
			                        h+="'"+rowdata.prdTypCd+"'";
		  	                        h+=')">'+value+'</a>'
		  	            		}
		  	                        return h;
		  	            		}, 
	  	            		enabledSort:true}, 
	            { display: '车架号', name: 'vin', minWidth: 80 ,align:'left',enabledSort:true},
	            { display: 'GPS卡号1', name: 'gpsCardNo', minWidth: 80 ,align:'left',enabledSort:true},
	            { display: 'GPS卡号2', name: 'gpsCardNo2', minWidth: 80 ,align:'left',enabledSort:true},
	            { display: '数量', name: 'prdQty', minWidth: 60,align:'left', enabledSort:true}, 
	            { display: '单价（元）', name: 'guidePc', minWidth: 60,align:'left', enabledSort:true}, 
	            { display: '小计（元）', name: 'guidePc', minWidth: 60,align:'left', 
	            		  totalSummary:
	                      {
	                          render: function (rowdata, column, cell)
	                          {
	                              return '<div style="color:red">合计:' + rowdata.sum + '</div>';
	                          },
	                          align: 'left'
	                      },
	                      render: function (rowdata, rowindex, value){
	                    	  var  total = NumberUtils.mul(rowdata.guidePc,rowdata.prdQty);
		                	  var h=" ";
		                	    	h+= total;
		                    return h;
		                },
	            		  enabledSort:true}, 
	             {
	                display: '操作',
	                isSort: false,
	                width: 200,
	                align:'left',
	                render: function (rowdata, rowindex, value){
	                	  var h="";
	                	  	//	if(isAuditNode&&isAuditNode==1){
		                        h='<a class="sq-button-hasicon" href="javascript:modifyBtn(';
		                        h+="'"+rowdata.dtlId+"',";
		                        h+="'"+rowdata.prdTypCd+"'";
		                        h+=')"><i class="sqBtnIco_4"></i>修改</a>';
	                	  //		}
		                        
	                    return h;
	                }
	            }  
	        ],
	        pageSize:10,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        width: '100%',
	        height:'100%',
	        heightDiff:-2,
	        checkbox:true,
	        allowUnSelectRow: true,
            alternatingRow: true,
	        rownumbers:true,
	        enabledEdit: true,
	    });
		grid = liger.get("grid");
		grid.setHeight(500);
		
	}

	
	//修改产品明细信息
	function modifyBtn(dtlId,prdTypCd){
		var callback = function(){
			 grid.reload();
		}
		var detailFlag = false;
		$.ligerDialog.open({  title: '修改车辆信息',height: 500,width: 1000, url:'<%=path%>/project/prjprddtl/toModifyPrjPrdDtlCarPrdInfoPage.do?detailFlag='+detailFlag+'&&dtlId='+dtlId+'&&prdTypCd='+prdTypCd+'&&isAuditNode='+isAuditNode,callback:callback});
		//Add_navTab( 'tab_prj_prd_dtl_info_edit'+dtlId,'修改车辆信息','<%=path%>/project/prjprddtl/toModifyPrjPrdDtlCarPrdInfoPage.do?detailFlag='+detailFlag+'&&dtlId='+dtlId+'&&prdTypCd='+prdTypCd,callback);
	}
	//产品明细详细信息
	function detailBtn(dtlId,prdTypCd){
		var detailFlag = true;
		Add_navTab( 'tab_prj_prd_dtl_info'+dtlId,'车辆信息详情','<%=path%>/project/prjprddtl/toModifyPrjPrdDtlCarPrdInfoPage.do?detailFlag='+detailFlag+'&&dtlId='+dtlId+'&&prdTypCd='+prdTypCd);
	}
	
	function iframeResize () {
	    if (parent.mainApp) {
	        parent.mainApp.parentTab.onResize();
	    };
	}
</script>

<body class="iframeBody">
	<div class="Wrapper">
           <div id="pageInTab" class="pageInTab">
<div id="grid" class="sq-grid"></div>
</div>
		</div>
			</div>
</body>
</html>